<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>会员自助广告位管理 - powered by 织梦技术研究中心！</title>
<link href="css/base.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="js/main.js"></script>
<script language="javascript" src="../include/dedeajax2.js"></script>
<script type="text/javascript">
<!--
function ShowAddCatalog(){
	$Obj('addCatalog').style.display='block';
}
function CloseAddCatalog(){
	$Obj('addCatalog').style.display='none';
}
function CloseEditCatalog(){
	$Obj('editCatalog').style.display='none';
}
function DelCatalog(cid){
	if(window.confirm("你确实要删除这个广告位吗？"))
	{
		location.href='mad_list.php?action=del&cid='+cid;
	}
}
function Lookuser(cid){
	$Obj('editCatalog').style.display='block';
	var myajax = new DedeAjax($Obj('editCatalogBody'),false,true,"","","请稍候，正在载入...");
	myajax.SendGet2('mad_list.php?cid='+cid+'&action=look');
	DedeXHTTP = null;
}
-->
</script>
<style type="text/css">
<!--
#addCatalog {
	position:absolute;
	left:455px;
	top:64px;
	width:330px;
	height:320px;
	z-index:1;
	background-color: #F2FDDB;
	border:1px solid #889D8F;
	padding:6px;
	display:none
}
#editCatalog {
	position:absolute;
	left:455px;
	top:64px;
	width:325px;
	height:260px;
	z-index:1;
	background-color: #F2FDDB;
	border:1px solid #889D8F;
	padding:6px;
	display:none
}
-->
</style>
</head>
<body background='images/allbg.gif' leftmargin='8' topmargin='8'>
<?php
if(empty($action))
{
?>
<div class="bodytitle">
	<div class="bodytitleleft"></div>
	<div class="bodytitletxt"><b>会员自助广告位管理</b></div>
</div>
<form action="mad_list.php" name="form1" method="get">
<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" bgcolor="#E2F5BC"  background="images/tbg.gif">
  <tr>
    <td width="81" align="center">
      <select name="tid" id="tid" style="width:120px">
      <option value="0">所有分类</option>
      <?php echo $options?>
      </select>
    </td>
    <td width="100" align="center">
       <select name="sales" id="sales">
		<option value="0">广告状态</option>
        <option value="1">上架</option>
        <option value="2">待上架</option>
		<option value="3">下架</option>
       </select>
    </td>
    <td width="100" align="center">
		<select name="type" id="type">
			<option value="0">广告类型</option>
             <option value="1">文字广告</option>
             <option value="2">图片广告</option>
			 <option value="3">Flash广告</option>
        </select>
    </td>
    <td width="250" align="center">价格范围:<input type='text' size='4' name="price1" id="price1" value="<?php echo $price1?>">→<input type='text' size='4' name="price2" id="price2" value="<?php echo $price2?>">(金币/周)
    </td>
    <td width="41" align="center"><input name="imageField" type="submit" class="np coolbg" value="筛选"/></td>
    <td align='right'> [<a href="javascript:ShowAddCatalog();"><u>添加广告</u></a>]
    </td>
  </tr>
</table>
</form>
<form name='frank' id='frank' action='mad_list.php' method='post'>
<table  width="98%" border="0" cellpadding="1" cellspacing="1" align="center" bgcolor="#E2F5BC" class="tbtitle">
        <tr align="center" bgcolor="#FBFCE2">
			<td width="5%">排序</td>
			<td width="5%">编号</td>
			<td width="15%">广告名称</td>
            <td width="15%">所属分类</td>
            <td width="12%">价格(金币/周)</td>
			<td width="8%">类型</td>
			<td width="10%">状态</td>
            <td width="15%">购买者</td>
            <td width="15%">管理操作</td>
    </tr>
		  
<input type='hidden' name='action' value='uprank' />
{dede:datalist}
		<tr align="center" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
        <td>
<input type='text' size='2' name='rank_<?php echo $fields['cid']?>' value='<?php echo $fields['lists']?>'>
		</td>
		<td><?php echo $fields['cid']?></td>
		<td><?php echo $fields['adname']?></td>
		<td><?php echo $fields['name']?></td>
		<td><b><?php echo $fields['price']?></b></td>
		<td>
		<?php
    	if($fields['adtype']==1) echo "文字";
		else if($fields['adtype']==2) echo "图片";
		else echo "Flash";
		?>
		</td>
		<td>
		<?php
    	if($fields['sales']==1) echo "上架";
		else if($fields['sales']==2) echo "待上架";
		else echo "下架";
		?>
		</td>
		<td>
		<?php if($fields['mcid']=='0') echo "未售出"; else{ ?>
		<a href='javascript:Lookuser(<?php echo $fields['cid']?>);' style="text-decoration:underline; color:#0000FF"><?php echo $fields['userid']?></a><?php if($fields['endtime']<time()) echo "<font style='color:#ccc'>(到期)</font>";?>
		
		<?php }?>
		</td>
		<td><a href="mad_list.php?action=getjs&cid={dede:field.cid /}">获取代码</a>|<a href="mad_list.php?action=edit&cid={dede:field.cid /}">更改</a>|<a href="javascript:DelCatalog(<?php echo $fields['cid']?>);">删除</a></td>
		</tr>
        {/dede:datalist}
        <tr bgcolor="#FFFFFF">
          <td height="30" colspan="9">
            <input type='Submit' name='Submit' value='更新排序' style='width:80px;' class="np coolbg"/></td>
        </tr>
        <tr align="center" bgcolor="#FFFFFF" height="3">
          <td colspan="9" >
          {dede:pagelist listitem="info,index,end,pre,next,pageno" listsize="10"/}
          </td>
        </tr>
</table>
</form>
<div id="editCatalog">
<span id='editCatalogBody'>请稍候，正在载入...</span>
</div>
<!--  下面是隐藏的栏目增加／修改表单  -->
<div id="addCatalog">
<form name='addform' id='addform' action='mad_list.php?action=add' method='post'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr background="images/tbg.gif">
   <td height="24" width="80"><strong>&nbsp;添加广告位</strong></td>
   <td align="right" valign="top" colspan="2"><a href="javascript:CloseAddCatalog()"><img src="images/close.gif" width="12" height="12" border="0" /></a></td>
  </tr>
  <tr>
    <td height="28">广告名称：</td>
    <td colspan="2"><input name="adname" type="text" size=18 id="adname" /> （用于会员页面显示)</td>
  </tr>
  <tr>
    <td height="28">所属分类：</td>
    <td colspan="2">
      <select name="tid" id="tid">
         <option value="0">--请选择--</option>
         <?php echo $options?>
      </select>
    </td>
  </tr>
  <tr>
    <td height="28">广告价格：</td>
    <td colspan="2"><input name="price" type="text" size=12 id="price" /> 金币/周</td>
  </tr>
  <tr>
    <td height="28">排列位置：</td>
    <td colspan="2"><input name="lists" type="text" id="lists" size="5" value="0" />（数值越小越靠前）
    </td>
  </tr>
  <tr>
    <td height="28">广告类型：</td>
    <td colspan="2">
      <select name="adtype" id="adtype">
        <option value="1">文字广告</option>
		<option value="2">图片广告</option>
		<option value="3">Flash广告</option>
      </select>
    </td>
  </tr>
  <tr>
    <td height="28">广告状态：</td>
    <td colspan="2">
    <select name="sales" id="sales">
      <option value="1">上架</option>
	  <option value="2">待上架</option>
	  <option value="3">下架</option>
    </select>
    </td>
  </tr>
  <tr>
    <td height="28">备用内容：</td>
    <td colspan="2">
   <input name="expbody" type="text" size="18" id="adname" /> （广告位售出前显示)
    </td>
  </tr>
  <tr>
    <td height="28">示意图：</td>
    <td colspan="2"><input name="litpic" type="text" id="litpic1" size="18" /> <input type="button" name="Submitss" value="站内选择" onClick="SelectImage('addform.litpic','');" class="np coolbg" />
    </td>
  </tr>
  <tr>
    <td height="28"></td>
    <td colspan="2">用于会员页面，展示广告具体显示位置，建议大小为300X400</td>
  </tr>
  <tr>
    <td height="43">&nbsp;</td>
    <td colspan="2"><input type="submit" name="Submit" value="提交" class="np coolbg" />&nbsp; &nbsp; <input type='button' value='关闭' onclick='javascript:CloseAddCatalog()'  class="np coolbg" /></td>
  </tr>
</table>
</form>
</div>
<?php
}elseif($action == 'edit')
{
?>
<form name="form2" action="mad_list.php" method="post">
<table width="96%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="	background:#E2F5BC;">
    <tr>
        <td colspan="2" bgcolor="#EDF9D5" background="images/tbg.gif"><a href="mad_list.php"><b>会员自助广告位管理</b></a>  ---  <strong style="color:#333">修改广告位</strong>
        <input type="hidden" name="action" value="edit" />
        <input type="hidden" name="step" value="2" />
        <input type="hidden" name="cid" value="<?php echo $cid; ?>" /></td>
    </tr>

	  <tr>
             <td width="150" height="20" align="right" bgcolor="#FFFFFF">广告名称：</td>
              <td height="20" bgcolor="#FFFFFF"><input name="adname" type="text" size=18 id="adname"  value="<?php echo $sector['adname']; ?>"/> （用于会员页面显示)</td>
            </tr>
	  <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">所属分类：</td>
        <td height="20" bgcolor="#FFFFFF"><select name="tid" id="tid">
		<option value="<?php echo $sector['tid']; ?>"><?php echo $sector['name']; ?></option>
                <option value="0">--请选择--</option>
				<option value="0" style="color:#999999">↓重新选择↓</option>
                <?php echo $options?>
              </select></td>
	   </tr>
	   <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">广告价格：</td>
        <td height="20" bgcolor="#FFFFFF"><input type="text" name="price" value=<?php echo $sector['price']; ?>>(用于会员页面，序号越小，排列越靠前)</td>
	  </tr>
	  <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">排列位置：</td>
        <td height="20" bgcolor="#FFFFFF"><input type="text" name="lists" value=<?php echo $sector['lists']; ?>>(用于会员页面，序号越小，排列越靠前)</td>
      </tr>
	  <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">广告类型：</td>
        <td height="20" bgcolor="#FFFFFF"><select name="adtype" >
                <option value="<?php echo $sector['adtype']; ?>">
                <?php
    	        if($sector['adtype']=='1') echo "文字广告";
		        else if($sector['adtype']=='2') echo "图片广告";
		        else echo "Flash广告";
		        ?></option>
				<option value="0" style="color:#999999">↓重新选择↓</option>
                <option value="1">文字广告</option>
				<option value="2">图片广告</option>
				<option value="3">Flash广告</option>
              </select> (如果广告位已经售出，务必不要修改此项)</td>
      </tr>
	  <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">广告状态：</td>
        <td height="20" bgcolor="#FFFFFF"><select name="sales" >
                <option value="<?php echo $sector['sales']; ?>">
                <?php
    	        if($sector['sales']=='1') echo "上架";
		        else if($sector['sales']=='2') echo "待上架";
		        else echo "下架";
		        ?></option>
				<option value="0" style="color:#999999">↓重新选择↓</option>
                 <option value="1">上架</option>
			  <option value="2">待上架</option>
			  <option value="3">下架</option>
              </select> (如果广告位已经售出，建议不要修改此项)</td>
      </tr>
	  <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">示意图：</td>
        <td height="20" bgcolor="#FFFFFF"><input name="litpic" type="text" style="width:130" value="<?php echo $sector['litpic']; ?>" /> <input type="button" name="Submitss" value="站内选择" style="width:90" onClick="SelectImage('form2.litpic','');" class='inputbut'>(用于会员页面，展示广告具体位置用，建议大小为300X400)</td>
      </tr>
	  <tr>
            <td width="150" height="20" align="right" bgcolor="#FFFFFF">开始时间：</td>
             <td height="20" bgcolor="#FFFFFF"><font style="color:#333"><?php
    	        if($sector['endtime']=='0') 
				{
				?>
               正在出售
				<?php
                 }
		        else 
				{
				?>
				<?php echo GetDateTimeMk($sector['starttime'])?>  |  如果你没有更改购买周数，到期时间为：<?php echo GetDateTimeMk($sector['endtime']);?>
				<?php
				}?></font></td>
          </tr>
          <tr>
            <td width="150" height="20" align="right" bgcolor="#FFFFFF">购买周数：</td>
             <td height="20" bgcolor="#FFFFFF"><input name="times" type="text" value="<?php echo $sector['times']; ?>" /></td>
       </tr>
<tr>
            <td width="150" height="20" align="right" bgcolor="#FFFFFF">正常显示↓</td>
             <td height="20" bgcolor="#FFFFFF">-------------↓购买者发布的信息↓-----------</td>
       </tr>
	 <?php echo $nbody?>

	 <tr>
            <td width="150" height="20" align="right" bgcolor="#FFFFFF">备用显示↓</td>
             <td height="20" bgcolor="#FFFFFF">
------↓广告位过期或售出前显示的内容↓------</td>
       </tr>
 <?php echo $ebody?>
        <td height="35" bgcolor="#FFFFFF">&nbsp;</td>
        <td bgcolor="#F8FCF1"><input name="submit2" type="submit" value="提交" class="np coolbg"/>&nbsp;&nbsp;<input type='button' value='返回' onclick='javascript:history.go(-1);'  class="np coolbg" /></td>
    </tr>

    </table>
<br>
<br>
</form>
<?php
}
?></body>
</html>